import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.Scanner;

class Staff{
    private int id;
    private double salary;
    private String name;
    private long time;
    private int month;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    @Override
    public String toString() {
        return "Staff{" +
                "id=" + id +
                ", salary=" + salary +
                ", name='" + name + '\'' +
                ", time=" + new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(time) +
                ", month=" + month +
                '}';
    }
}
public class Main {
    public static List<Staff> list=new ArrayList<>();
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int count=3;
        while (count>0){
            count--;
            System.out.println("请输入员工姓名");
            String name=in.next();
            System.out.println("请输入员工工资的月份");
            int month=in.nextInt();
            System.out.println("请输入员工工资的工资");
            double salary=in.nextDouble();
            Staff staff=new Staff();
            staff.setMonth(month);
            staff.setName(name);
            staff.setSalary(salary);
            staff.setId(list.size()==0?1:list.size()+1);
            Date date=new Date();
            long time=date.getTime();
            staff.setTime(time);
            list.add(staff);
//            System.out.println(staff);
        }
        for (int i = 0;i <list.size() ; i++) {
            System.out.println(list.get(i));
        }
        System.out.println("请输入需要删除的记录id");
        int id=in.nextInt();
        if (list.size()==0||list==null||list.size()<id){
            System.out.println("删除失败，id错误");
        }else {
            list.remove(id-1);
        }
        System.out.println("==============");
        for (int i = 0;i <list.size() ; i++) {
            System.out.println(list.get(i));
        }
    }
}
